<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@page import="com.lmpop.trade.ti_finance.*" %>
<%@page import="java.util.*" %>
<%@page import="com.lmpop.frame.util.PageTools" %>
<%@page import="com.lmpop.trade.ti_finance_history.*" %>

<%
	request.setCharacterEncoding("UTF-8");
	Map ti_finance = new Hashtable();
	String session_cust_id="";
	if(session.getAttribute("session_cust_id")!=null){
	  session_cust_id=session.getAttribute("session_cust_id").toString(); 
	}
//out.print(session_cust_id);		
	Ti_financeInfo ti_financeInfo = new Ti_financeInfo();
	String iStart = "0";
	int limit = 20;
	if(request.getParameter("iStart")!=null) iStart = request.getParameter("iStart");
	List list = ti_financeInfo.getListByPk(session_cust_id);
	Hashtable mapp = new Hashtable();
  	if(list!=null && list.size()>0) mapp = (Hashtable)list.get(0);
	String cust_idd=session_cust_id,vmoney="0",use_vmoney="",frz_vmoney="",inter="",use_inter="",frz_inter="",remarkk="";
	String cust_name = "";
	if(mapp.get("cust_idd")!=null) cust_idd = mapp.get("cust_idd").toString();
	if(mapp.get("vmoney")!=null) vmoney = mapp.get("vmoney").toString();
	if(mapp.get("inter")!=null) inter = mapp.get("inter").toString();
	
	Map ti_finance_history = new Hashtable();
	ti_finance_history.put("cust_id",session_cust_id);
	ti_finance_history.put("type","0");
	Ti_finance_historyInfo ti_finance_historyInfo = new Ti_finance_historyInfo();
	List listt = ti_finance_historyInfo.getListByPage(ti_finance_history,Integer.parseInt(iStart),limit);	
	int counter = ti_finance_historyInfo.getCountByObj(ti_finance_history);
	String pageString = new PageTools().getGoogleToolsBar(counter,"index.jsp?iStart=",Integer.parseInt(iStart),limit);
%>

<div class="f-right w750">
	<form action="index.jsp" name="homeForm" method="post">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" >
      <tr>
        <td><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#eddfea">
            <tr>
              <td width="5%" height="40" align="center"><img src="/program/member/index/images/icon1.gif" /></td>
              <td width="75%"><h3>查看积分明细</h3></td>
            </tr>
          </table>
		  <!--
		  		<div class="ts"> <img src="/program/member/index/images/ts.gif" /></div>
		  -->
          <table width="100%" border="0" cellspacing="0" cellpadding="0" style="border:1px solid #EDDFEA;">
            <tr>
              <td height="45" align="left">
              	操作名称:<input name="trade_name" id="trade_name" type="text" class="input">
                &nbsp;&nbsp;
								按时间段选择:
							 	<input name="txtStartDate" type="text" id="txtStartDate" class="Wdate" value="" onclick="WdatePicker({maxDate:'#F{$dp.$D(\'txtEndDate\',{d:-1})}',readOnly:true})" size="15" />
									- 
								<input name="txtEndDate" id="txtEndDate" type="text" class="Wdate" value="" onclick="WdatePicker({minDate:'#F{$dp.$D(\'txtStartDate\',{d:1})}',readOnly:true})" size="15"/>
								
                <input name="searchInfo" type="button" onclick="return search()" value="搜索"  class="btn_right"/>	
            </tr>
          </table>
			  <% 
				int listsize = 0;
				if(listt!=null && listt.size()>0){
					listsize = listt.size();
			%>   
          <table width="100%"  height="30" border="0" bgcolor="#eddfea"  cellspacing="0" cellpadding="2">
            <tr>
              <!--<td width="20%" align="left">操作名称</td>-->
              <td width="20%" align="left">变化积分数</td>
              <td width="30%" align="left">变化原因</td>
              <td width="20%" align="left">时间</td>
            </tr>
          </table>
         <% 
		  		for(int i=0;i<listt.size();i++){
		  			Hashtable map = (Hashtable)listt.get(i);
		  			String trade_id="",cust_id="",num="",vtype="",reason="",in_date="",_user_id="",remark="";
		  			  	if(map.get("trade_id")!=null) trade_id = map.get("trade_id").toString();
						if(map.get("cust_id")!=null) cust_id = map.get("cust_id").toString();
						if(map.get("num")!=null) num = map.get("num").toString();
						if(map.get("type")!=null) vtype = map.get("type").toString();
						if(map.get("reason")!=null) reason = map.get("reason").toString();
						if(map.get("in_date")!=null) in_date = map.get("in_date").toString();
						if(in_date.length()>19)in_date=in_date.substring(0,19);
						if(map.get("user_id")!=null) _user_id = map.get("user_id").toString();
						if(map.get("remark")!=null) remark = map.get("remark").toString();

		  %>
          <table width="100%" border="0" cellpadding="0" cellspacing="0" style="border-bottom:1px dashed #acacac">
            <tr height="80">
              <td width="20%" align="left"><%=num%></td>
              <td width="30%" align="left"><%=reason%></td>
              <td width="20%" align="left"><%=in_date%></td>
            
            </tr>
          </table>
          <%
          		}
          
          %>
          
          <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td width="4%" height="35" align="center">
              	<%=pageString%>
              </td>
            </tr>
          </table>
         <%
		 }
	%> 
              	<input type="hidden" name="listsize" id="listsize" value="<%=listsize %>" />
	  						<input type="hidden" name="pkid" id="pkid" value="" />
	  						<input type="hidden" name="bpm_id" id="bpm_id" value="3485" />
          
        </td>
      </tr>
    </table>
   </form>
  </div>